# User driven .irbrc file for working in interactive ruby sessions, ie. a Ruby REPL
# github.com/ipatch
# twitter.com/truckmonth
#

require 'irb/completion'
require 'date'
require 'irb/ext/save-history'

IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"

def pbcopy(input)
  str = input.to_s
  IO.popen('pbcopy', 'w') { |f| f << str }
  str
end

def pbpaste
  `pbpaste`
end

# thanks @flatiron-school
# show local methods first on instance classes that inherit from the overall base object ruby class
class Object
  def lm
    (self.methods - Object.methods).sort
  end

  def lim
    (self.instance_methods - Object.instance_methods).sort
  end
end
